Advertisement

Virtual machine for scripting

Started by May 11, 2003 10:32 PM
0 comments, last by Polydone 21 years, 6 months ago
I''m creating a scripting language to control virtual robots. It will be compiled for a virtual machine, and at the moment I have a prototype, a stack machine: It has one stack, one array for variables (only static allocation), one array for instructions(and literal values) and a program counter. I''m wondering if a register based approach would be more efficient, do any of you have any experience with that? *** For Java games and Java related resources, go to http://www.javaengines.dk ***

Developer journal: Multiplayer RPG dev diary

I wrote a C Compiler/VM with a stack, variable array and instruction linked list. Worked great.

I wouldn't try using registers... what's the point if it's a virtual machine? Plus you've gotta write the compiler to decide when to load registers/etc. I just loaded onto the stack with mine.


Right now I'm using the built-in C# compiler with the .NET framework as a "scripting" language (really it's just runtime compilable pluggable source)... it actually compiles just like normal (but without optimizations).

[edited by - Nypyren on May 11, 2003 11:47:11 PM]

This topic is closed to new replies.

Advertisement